<%@page import="com.project.model.Jobs"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.project.db.SQLHelper"%>
<%@page import="com.project.model.Resume"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	Cookie[] cookie = request.getCookies();
	String id = "";
	for (Cookie c : cookie) {
		if (c.getName().equals("userid")) {
			id = c.getValue();
		}
	}
	Resume resume = SQLHelper.getInfo(id);
	ArrayList<Jobs> jobs = new ArrayList<Jobs>();
	jobs = SQLHelper.getJob(id);
	String username = SQLHelper.getName(id);
%>
<html lang="zh-cn">
<head>
<meta charset="utf-8" />
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link href="css/app-resume.css" rel="stylesheet">
</head>
<body>
	<nav>
	<div style="width: 100%; height: 5px; background-color: #444;"></div>
	<div class="container">
		<div class="tran">My Resume</div>
		<ul>
			<li><p>
					<%=username%>，你好。 <a href="#">个人中心</a>
				</p></li>
			<li><a href="http://offerproject.jd-app.com/">退出</a></li>
		</ul>
	</div>
	</nav>
	<div class="container" style="margin-top: 50px;">
		<h3 style="line-height: 35px; font-size: 16px; font-weight: bold;">>我的简历/My
			Resume</h3>
		<div class="item">
			<table>
				<thead>
					<tr style="background-color: #F8F8F8;">
						<th>简历类型
							<p>Resume Type</p>
						</th>
						<th>创建时间
							<p>Date of Creation</p>
						</th>
						<th>最后更新时间
							<p>Last Update</p>
						</th>
						<th>操作
							<p>Modify</p>
						</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td>校招简历
							<p>Campus Recruitment</p>
						</td>
						<td><%=resume.getEdittime()%></td>
						<td><%=resume.getCreatetime()%></td>
						<td><a href="/resumeinfo.jsp" <%=id%>>预览</a> <a
							href="/editresume.jsp" <%=id%>>编辑</a><a href="/selectjob.jsp"
							<%=id%>>投递新职位</a></td>
					</tr>
				</tbody>
			</table>
		</div>
	</div>
	<div class="container" style="margin-top: 50px;">
		<h3 style="line-height: 35px; font-size: 16px; font-weight: bold;">>我的投递/My
			Status</h3>
		<%
			for (int i = 0; i < jobs.size(); i++) {
		%>
		<div class="item">
			<table>
				<thead>
					<tr style="background-color: #F8F8F8;">
						<th style="min-width: 350px;">职位名称
							<p>Position Title</p>
						</th>
						<th>申请日期
							<p>Date of Apply</p>
						</th>
						<th>当前招聘进度
							<p>Status</p>
						</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td><%=jobs.get(i).getJobs()%>
							<p><%=jobs.get(i).getCompany()%></p></td>
						<td><%=jobs.get(i).getDate()%></td>
						<%
							int state = jobs.get(i).getState();
								String strState = "";
								if (state == 0) {
									strState = "新投递";
								} else if (state == 1) {
									strState = "一面中";
								} else if (state == 2) {
									strState = "二面中";
								} else if (state == 3) {
									strState = "二面通过";
								} else if (state == 4) {
									strState = "回绝";
								}
						%>
						<td><%=strState%></td>
					</tr>
				</tbody>
			</table>
		</div>
		<%
			}
		%>
	</div>
</body>
</html>